package com.lx.springboot.service;

import com.lx.springboot.entity.Book;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
public class BookService {

//    private String a="aa";

    @RabbitListener(queues = "atguigu.news")
    public void getMsg(Book book){
        System.out.println("recieve message: "+ book);

    }

    @RabbitListener(queues = "atguigu")
    public void getMessage(Message message){
        System.out.println("recieve message: "+ message.getMessageProperties() + "\n"+message.getBody());
    }


}
